home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsIEventTarget.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  3KB  |  119 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIEventTarget.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIEventTarget_h__
  6. #define __gen_nsIEventTarget_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. #include "plevent.h"
  18.  
  19. /* starting interface:    nsIEventTarget */
  20. #define NS_IEVENTTARGET_IID_STR "ea99ad5b-cc67-4efb-97c9-2ef620a59f2a"
  21.  
  22. #define NS_IEVENTTARGET_IID \
  23.   {0xea99ad5b, 0xcc67, 0x4efb, \
  24.     { 0x97, 0xc9, 0x2e, 0xf6, 0x20, 0xa5, 0x9f, 0x2a }}
  25.  
  26. /**
  27.  * nsIEventTarget
  28.  *
  29.  * This interface is used to dispatch events to a particular thread.  In many
  30.  * cases the event target also supports nsIEventQueue.
  31.  */
  32. class NS_NO_VTABLE nsIEventTarget : public nsISupports {
  33.  public: 
  34.  
  35.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IEVENTTARGET_IID)
  36.  
  37.   /**
  38.      * Method for posting an asynchronous event to the event target.  If this
  39.      * method succeeds, then the event will be dispatched on the target thread.
  40.      *
  41.      * @param aEvent
  42.      *        The event to dispatched.
  43.      */
  44.   /* [noscript] void postEvent (in PLEventPtr aEvent); */
  45.   NS_IMETHOD PostEvent(PLEvent * aEvent) = 0;
  46.  
  47.   /**
  48.      * This method returns true if the event target is the current thread.
  49.      */
  50.   /* boolean isOnCurrentThread (); */
  51.   NS_IMETHOD IsOnCurrentThread(PRBool *_retval) = 0;
  52.  
  53. };
  54.  
  55. /* Use this macro when declaring classes that implement this interface. */
  56. #define NS_DECL_NSIEVENTTARGET \
  57.   NS_IMETHOD PostEvent(PLEvent * aEvent); \
  58.   NS_IMETHOD IsOnCurrentThread(PRBool *_retval); 
  59.  
  60. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  61. #define NS_FORWARD_NSIEVENTTARGET(_to) \
  62.   NS_IMETHOD PostEvent(PLEvent * aEvent) { return _to PostEvent(aEvent); } \
  63.   NS_IMETHOD IsOnCurrentThread(PRBool *_retval) { return _to IsOnCurrentThread(_retval); } 
  64.  
  65. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  66. #define NS_FORWARD_SAFE_NSIEVENTTARGET(_to) \
  67.   NS_IMETHOD PostEvent(PLEvent * aEvent) { return !_to ? NS_ERROR_NULL_POINTER : _to->PostEvent(aEvent); } \
  68.   NS_IMETHOD IsOnCurrentThread(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsOnCurrentThread(_retval); } 
  69.  
  70. #if 0
  71. /* Use the code below as a template for the implementation class for this interface. */
  72.  
  73. /* Header file */
  74. class nsEventTarget : public nsIEventTarget
  75. {
  76. public:
  77.   NS_DECL_ISUPPORTS
  78.   NS_DECL_NSIEVENTTARGET
  79.  
  80.   nsEventTarget();
  81.  
  82. private:
  83.   ~nsEventTarget();
  84.  
  85. protected:
  86.   /* additional members */
  87. };
  88.  
  89. /* Implementation file */
  90. NS_IMPL_ISUPPORTS1(nsEventTarget, nsIEventTarget)
  91.  
  92. nsEventTarget::nsEventTarget()
  93. {
  94.   /* member initializers and constructor code */
  95. }
  96.  
  97. nsEventTarget::~nsEventTarget()
  98. {
  99.   /* destructor code */
  100. }
  101.  
  102. /* [noscript] void postEvent (in PLEventPtr aEvent); */
  103. NS_IMETHODIMP nsEventTarget::PostEvent(PLEvent * aEvent)
  104. {
  105.     return NS_ERROR_NOT_IMPLEMENTED;
  106. }
  107.  
  108. /* boolean isOnCurrentThread (); */
  109. NS_IMETHODIMP nsEventTarget::IsOnCurrentThread(PRBool *_retval)
  110. {
  111.     return NS_ERROR_NOT_IMPLEMENTED;
  112. }
  113.  
  114. /* End of implementation class template. */
  115. #endif
  116.  
  117.  
  118. #endif /* __gen_nsIEventTarget_h__ */
  119.